#include <iostream>
#include <string>

using namespace std;

class Point
{
private:
    int x;
    int y;
public:
    Point() {this->x = 0; this->y = 0;}
    Point(int x, int y) : x(x), y(y) {}
    ~Point() {}
public:
    void show()
    {
        cout << "当前坐标: x = " << this->x << " y = " << this->y << endl;
    }
public:
    // 前置自增
    Point& operator++(void)
    {
        ++this->x;
        ++this->y;
        return *this;
    }
    // 后置自增
    const Point operator++(int)
    {
        Point temp = *this;
        ++this->x;
        ++this->y;
        return temp;
    }
    // 单目运算符 判定坐标是否为0
    bool operator!()
    {
        return !((this->x == 0) && (this->y == 0));
    }

    // 左移运算符
    friend ostream & operator<<(ostream &os,Point &pox);
    /*
        全局函数
        参数
            Point
            ostream

        返回值 ostream

    */
};

// 左移运算符
ostream & operator<<(ostream &os,Point &pox)
{
    os << "重载的输出: x = " << pox.x << " y = " << pox.y ;
    return os;
}

int main(int argc, char const *argv[])
{
    Point pox_1(50,50);
    //++++pox_1;
    //pox_1++;
    //pox_1.show();

    //cout << !pox_1 << endl;

    cout << pox_1 << endl;
    
    return 0;
}
